home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_movetest.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  112 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_truckjump.cog
  4. #
  5. # Babylon entry gate truck puzzle.
  6. #
  7. #
  8. # [SXC]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.         message        startup
  16.         message        activate
  17.         message        arrived
  18.  
  19.         surface        startswitch
  20.         surface        flowswitch
  21.         surface        flowcont0
  22.         surface        flowcont1
  23.  
  24.         thing            target0
  25.         thing            target1
  26.         thing            target2
  27.         thing            target3
  28.         
  29.         thing            truck0
  30.         thing            truck1
  31.         thing            truck0pos
  32.         thing            truck1pos
  33.  
  34.         int            lastframe = 3                        //number of last ghost target
  35.         int            movespeed = 1.0
  36.  
  37.         template        truck
  38. end
  39.  
  40. # ========================================================================================
  41. code
  42.  
  43. startup:
  44.  
  45.         truck0 = CreateThing(truck, truck0pos);    //create entering truck
  46.         CaptureThing(truck0);
  47.         truck1 = CreateThing(truck, truck1pos);    //create exiting truck
  48.         CaptureThing(truck1);
  49.  
  50.       SetActorFlags(truck0, 0x2000);                //put ai's to hard sleep
  51.         SetActorFlags(truck1, 0x2000);
  52.         
  53.  
  54.         ClearAdjoinFlags(flowcont0,2);                //nomove
  55.         ClearAdjoinFlags(flowcont1,2);
  56.  
  57.         SetFaceGeoMode(flowcont0, 3);                   //transluecent
  58.         SetFaceGeoMode(flowcont1, 3);
  59.  
  60.         targ0cnt = 0;
  61.  
  62. return;
  63.  
  64. # ........................................................................................
  65. activate:
  66.  
  67. if (GetSenderRef() == startswitch)
  68. {
  69.         AIActorFlags(truck0, 0x1000);                //wake AIs up
  70.         AIActorFlags(truck1, 0x1000);
  71.  
  72.         AISetMoveSpeed(truck0, 1.5);                //set ai movespeed
  73.         AISetMoveSpeed(truck1, 1.5);
  74.  
  75.         AISetMoveThing(truck0, target0[targ0cnt]);
  76.  
  77. }
  78.  
  79.  
  80. if (GetSenderRef() == flowswitch)
  81. {
  82.         SetAdjoinFlags(flowcont0,2);                // nomove
  83.         SetAdjoinFlags(flowcont1,2);
  84.  
  85.         SetFaceGeoMode(flowcont0, 0);               //    transparent
  86.         SetFaceGeoMode(flowcont1, 0);      
  87. }
  88. return;
  89.  
  90. # .......................................................................................
  91. arrived:
  92.  
  93. if ((GetSenderRef() == truck0) &&
  94.      (GetCurFrame(truck0) < (lastframe)))
  95. {
  96.         targ0cnt = targ0cnt + 1;
  97.         AISetLookPos(truck0, GetThingPos(target0[targ0cnt]));
  98.         AISetMoveThing(truck0, target0[targ0cnt]);
  99. }
  100. else if (GetCurFrame(truck0) == lastframe)
  101. {
  102.         targ0cnt = 0;
  103.         DestroyThing(truck0);
  104. }
  105. return;
  106.  
  107. end
  108.  
  109.  
  110.  
  111.  
  112.